<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/include/TagLib.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>设置帐号</title>
	<link rel="stylesheet" type="text/css" href="<c:url value='/index_files/comm20100fad0d.css' />">
	<link rel="stylesheet" type="text/css" href="<c:url value='/index_files/getcss.css' />">
	<link href="<c:url value='/index_files/kindedior/themes/default/default.css' />" rel="stylesheet">
	<link type="text/css" rel="stylesheet" href="<c:url value='/index_files/setting0f6e54.css' />">
	<script language="javascript" src="<c:url value='/js/jquery-1.4.2.min.js' />"></script>
	<script language="javascript"  src="<c:url value='/js/Valid.js' />"></script>
	<script type="text/javascript">
		//保存
		function saveUserMail(){
			if(Validator.Validate(document.form1,2)){
				//验证密码是否一样
				if($('#password').val()!=$('#password2').val()){
					alert("密码不一致，请重新输入！");
					return;
				}
				document.form1.action="<c:url value='/saveAccount.do' />";
				document.form1.submit();
			}
		}
		//清空
		function cancel(){
			$('#username').val('');
			$('#email').val('');
			$('#password').val('');
			$('#password2').val('');
			$('#pop').val('');
			$('#imap').val('');
			$('#smtp').val('');
		}
		//加载
		$(function($){
			$('#username').attr("dataType","Require").attr("msg","姓名不能为空！");
			$('#email').attr("dataType","Email").attr("msg","Email格式有误！");
			$('#password').attr("dataType","Require").attr("msg","密码不能为空！");
		});
	</script>
  </head>
  <body>
  	 ${fun==1?'新增':'修改'}
  	 <hr>
     <form id="form1" method="post" name="form1">
     	<table>
     		<tr>
     			<td colspan="2"><b>用户信息</b></td>
     		</tr>
     		<tr>
     			<td>您的姓名(Y)：</td>
     			<td><input type="text" name="username" id="username" value="${tblUserMail.username}"/></td>
     		</tr>
     		<tr>
     			<td>电子邮件地址(E)：</td>
     			<td><input type="text" name="email" id="email" value="${tblUserMail.email}"/></td>
     		</tr>
     		<tr>
     			<td>密码：</td>
     			<td><input type="password" name="password" id="password" value="${tblUserMail.password}"/></td>
     		</tr>
     		<tr>
     			<td>密码确认：</td>
     			<td><input type="password" name="password2" id="password2" value="${tblUserMail.password}"/></td>
     		</tr>
     		<tr>
     			<td colspan="2"><b>服务器信息</b></td>
     		</tr>
     		<tr>
     			<td>接收邮件服务器（POP3）：</td>
     			<td><input type="text" name="pop" id="pop" value="${tblUserMail.pop}"/></td>
     		</tr>
     		<tr>
     			<td>接收邮件服务器（IMAP）：</td>
     			<td><input type="text" name="imap" id="imap" value="${tblUserMail.imap}"/></td>
     		</tr>
     		<tr>
     			<td>发送邮件服务器（SMTP）：</td>
     			<td><input type="text" name="smtp" id="smtp" value="${tblUserMail.smtp}"/></td>
     		</tr>
     		<tr>
     			<td colspan="2">
     				<a href="javascript:saveUserMail();"  class="left bold button_green_md">&nbsp;保存&nbsp;</a>
     				<a href="javascript:cancel();"  class="left bold button_green_md">&nbsp;清空&nbsp;</a>
     				<a href="JavaScript:history.go(-1);"  class="left bold button_green_md">&nbsp;返回&nbsp;</a>
     				<input type="hidden" name="newIdUserMail" value="${tblUserMail.idUserMail}" />
     				<input type="hidden" name="idUserMail" value="${idUserMail}" />
     			</td>
     		</tr>
     	</table>
     </form>
  </body>
</html>
